package com.cloud.user.service.impl;

import com.cloud.user.entity.User;
import com.cloud.user.repositories.UserRespository;
import com.cloud.user.service.GenericService;
import com.cloud.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;

/**
 * Created by Administrator on 2018/1/7.
 */
@Service
@Transactional
public class UserServiceImpl extends GenericService implements UserService {

    @Autowired
    private UserRespository userRespository;

    @Override
    public User checkUserExits(String userName) {
        User result = null;
        if(userName != null) {
            result = userRespository.findByUserName(userName);
        }
        return result;
    }

    @Override
    public String getUserRole(User user) {
        return null;
    }

    @Override
    public void pwdInit(User user, String newPwd) {

    }

    @Override
    public int getUsersOfThisRole(String id) {
        return 0;
    }

    @Override
    public String trueDel(User user) {
        return null;
    }
}
